import {reactive} from "vue";
import type {User} from "@/types/user";
import type {AddressEditInfo, AddressListAddress} from "vant";


const loginState = reactive<{
    email: string;
    password: string;
}>({
    email: "",
    password: ""
});

const userState = reactive<{
    user: User.Dto;
}>({
    user: {}
});

const addressState = reactive<{
    list: AddressListAddress[]
}>({
    list: []
});

const areaList = reactive<{
    province_list: object;
    city_list: object;
    county_list: object;
}>({
    province_list: {}, // 省
    city_list: {}, // 市
    county_list: {} // 县
});

const state = reactive<{
    type:string;
    addressId:string;
    addressInfo: AddressEditInfo,
}>({
    type:'add',
    addressId:'',
    addressInfo:{
        tel:'',
        name: '',
        city: '',
        county: '',
        country: '',
        province: '',
        areaCode: '',
        addressDetail: '',
    },
})


export {loginState, userState, addressState, areaList,state};